import { createRouter, createWebHistory } from 'vue-router';
import DrugPage from '@/views/DrugPage.vue';
import CartPage from '@/views/CartPage.vue';
import OrderPage from "@/views/OrderPage.vue";
import UserPage from "@/views/UserPage.vue";
const routes = [
  {
    path: '/',
    name: 'Home', // 路由名称
    component: DrugPage,
  },
  {
    path: '/cart',
    name: 'Cart',
    component: CartPage,
  },
  {
    path: '/order',
    name: 'Order',
    component: OrderPage,
  },
  {
    path: '/user',
    name: 'User',
    component: UserPage,
  }
];
// 创建路由实例
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});
// 导出路由实例，作用是在main.js中挂载到Vue实例上
export default router;
